<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" id="vp" content="width=device-width, initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<title>童圈</title>
		<link href="../../css/style.css" rel="stylesheet" type="text/css">
		<link href="../../css/mui.css" rel="stylesheet" type="text/css">
	</head>

	<body>
		<div id="children" class="myself">
			<!--消息列表-->
			<div class="list-frame" id="list">
				<ul class="list-info">
					<template v-for="(item,index) in items" :key="index">
						<li class="list-info-li" @tap="newmsgdetail(item)">
							<div class="main clearfix">
								<div :style="{backgroundImage:'url(' + item.pic + ')'}" class="people-l fl"></div>
								<div class="list-info-li-r fl">
									<div class="name posir">
										<div class="name-text">{{item.name}}</div>
										<span class="pinglunname">{{item.content}}</span>
									</div>
								</div>
							</div>
						</li>
					</template>
				</ul>
			</div>
		</div>
		<!--轮播banner-->
		<script src="../../js/mui.js"></script>
		<script src="../../js/vue.min.js"></script>
		<script src="../../js/app.js"></script>
		<script src="../../js/token.js"></script>
		<script src="../../js/iconfont.js"></script>
		<script src="../../js/jquery-1.8.3.min.js"></script>
		<script>
			var state;
			//mui初始化，配置下拉刷新
			mui.init();

			mui.plusReady(function() {
				state = app.getState();
				memberToken=state.memberToken
				if(window.plus && plus.networkinfo.getCurrentType() === plus.networkinfo.CONNECTION_NONE) {
					plus.nativeUI.toast('似乎已断开与互联网的连接', {
						verticalAlign: 'top'
					});
					return;
				}
				var data = {
					uid: state.userid,
					memberToken: memberToken
				};

				//获取消息列表
				mui.post(Apiurl+'index/pinglist', data, function(data) { 
					children.items = data;
					
				}, 'json');
			});

			var children = new Vue({
				el: '#children',
				data: {
					banners: [], //顶部banner数据
					items: [], //列表信息流数据
					fold: true,
					clickTf: true,
					activeindex: 0
				},
				methods: {
					newmsgdetail: function(item) {
						mui.openWindow({
							url: './detail.html',
							id: 'moments_detail',
							preload: true,
							extras: {
								messageid: item.message_id
							},
							show: {
								aniShow: 'pop-in',
								autoShow: true
							},
							styles: {
								"render": "always",
								"popGesture": "hide",
								"bounce": "vertical",
								"bounceBackground": "#efeff4",
								"titleNView": { //详情页原生导航配置
									backgroundColor: '#fff', //导航栏背景色
									titleText: '消息详情', //导航栏标题
									titleColor: '#000', //文字颜色
									autoBackButton: true, //自动绘制返回箭头
									splitLine: { //底部分割线
										color: '#DFDFDF'
									}
								}
							},
							waiting: {
								autoShow: true
							}
						});
					}
				}
			});
		</script>
	</body>

</html>